import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_eve_plugin/components/ye_xiu/archives/archives_get_dialog_content.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/utils/image_util.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class ArchivesGetDialog extends Dialog {
  ArchivesGetDialog({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        if (Navigator.canPop(context)) {
          Navigator.pop(context);
        }
      },
      child: Material(
        type: MaterialType.transparency,
        child: Center(
          child: Stack(
            overflow: Overflow.visible,
            children: <Widget>[
              Container(
                transform: Matrix4.translationValues(0, setRatio(-60), 0),
                width: setRatio(311),
                height: setRatio(241),
                decoration: BoxDecoration(
                    gradient: LinearGradient(
                      colors: [
                        Color(0xff4C4F5D),
                        Color(0xf2757C90),
                      ],
                      begin: Alignment.topCenter,
                      end: Alignment.bottomCenter,
                    ),
                    border: Border.all(
                        color: Color(0xFFB6BED7), width: setRatio(1)),
                    borderRadius: BorderRadius.circular(setRatio(10))),
              ),
              Container(
                width: setRatio(151),
                height: setRatio(44),
                transform:
                    Matrix4.translationValues(setRatio(80), setRatio(-80), 0),
                decoration: BoxDecoration(
                    image: DecorationImage(
                        image: AssetImage(imageUtilYeXiu(
                            'checkpoint/icon_center_dialog_title_bg@3x')))),
                child: Center(
                  child: Text(
                    '获取途径',
                    style: TextStyle(
                        color: Color(0xFFFFFFFF),
                        fontFamily: FontFamily.PMZD,
                        fontSize: setTextSp(19)),
                  ),
                ),
              ),
              Positioned(
                top: setRatio(-20),
                right: setRatio(38),
                left: setRatio(38),
                child: ArchivesGetDialogContentWidget(),
              ),
              Positioned(
                bottom: setRatio(10),
                left: 0,
                right: 0,
                child: Text(
                  '点击任意屏幕继续',
                  textAlign: TextAlign.center,
                  style: TextStyle(
                      letterSpacing: 1,
                      color: Color(0xFFFFFFFF),
                      fontFamily: FontFamily.PINGFANG,
                      fontWeight: FontWeightCustom.PF_Medium,
                      fontSize: 12),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
